package view
{
	import flash.display.Bitmap;
	import flash.display.Graphics;
	import flash.display.Sprite;
	
	public class View extends Sprite
	{
		[Embed(source="icon/uploadBtn.png")]
		private var uploadBtnBD:Class;
		[Embed(source="icon/uploadText.png")]
		private var uploadTextBD:Class;
		[Embed(source="icon/splitLine.png")]
		private var splitLineBD:Class;
		[Embed(source="icon/tooltipText.png")]
		private var tooltipTextBD:Class;
		
		[Embed(source="icon/saveBtn.png")]
		private var saveBtnBD:Class;
		[Embed(source="icon/cancelBtn.png")]
		private var cancelBtnBD:Class;
		
		private var _width:Number=770;
		private var _height:Number=550;
		
		private var _uploadBtn:Button;
		private var _uploadText:Bitmap;
		private var _cutArea:CutArea;
		private var _splitLine:Bitmap;
		private var _toolTipText:Bitmap;
		private var _prview:PrviewArea;
		private var _saveBtn:Button;
		private var _cancelBtn:Button;
		
		public function View()
		{
			super();
			init();
			layout();
		}
		private function init():void
		{
			var g:Graphics=this.graphics;
			g.beginFill(0xffffff);
			g.drawRect(0,0,_width,_height);
			_uploadBtn=new Button(new uploadBtnBD);
			_uploadText=new uploadTextBD;
			_cutArea=new CutArea;
			_splitLine=new splitLineBD;
			_toolTipText=new tooltipTextBD;
			_prview=new PrviewArea;
			_saveBtn=new Button(new saveBtnBD);
			_cancelBtn=new Button(new cancelBtnBD);
			addChild(_uploadBtn);
			addChild(_uploadText);
			addChild(_cutArea);
			addChild(_splitLine);
			addChild(_prview);
			addChild(_toolTipText);
			addChild(_saveBtn);
			addChild(_cancelBtn);
		}
		private function layout():void
		{
			_uploadBtn.x=58;
			_uploadBtn.y=26;
			_uploadText.x=60;
			_uploadText.y=81;
			_cutArea.x=57;
			_cutArea.y=130;
			_splitLine.x=435;
			_splitLine.y=131;
			_toolTipText.x=483;
			_toolTipText.y=139;
			_prview.x=500;
			_prview.y=195;
			_saveBtn.x=269;
			_saveBtn.y=496;
			_cancelBtn.x=409;
			_cancelBtn.y=496;
		}
		public function showBottomBtn(value:Boolean):void
		{
			_saveBtn.visible=_cancelBtn.visible=value;
		}
		
		public function get uploadBtn():Button
		{
			return _uploadBtn;
		}

		public function get saveBtn():Button
		{
			return _saveBtn;
		}

		public function get cancelBtn():Button
		{
			return _cancelBtn;
		}

		public function get cutArea():CutArea
		{
			return _cutArea;
		}

		public function get prview():PrviewArea
		{
			return _prview;
		}


	}
}